home *** CD-ROM | disk | FTP | other *** search
- /****i* SOURCE_FILE/INFO
- *
- * NAME
- * UpdatesMainWindow.js
- *
- * USAGE
- * Part of Netobjects JavaScript Library.
- *
- * COPYRIGHT
- * Copyright ⌐ 2002-2004 Website Pros, Inc.
- * All Rights Reserved.
- *
- * This is an unpublished work protected by Website Pros, Inc.
- * as a trade secret, and is not to be used or disclosed except as
- * expressly provided in a written license agreement executed by
- * you and Website Pros, Inc.
- *
- * <copyright@websitepros.com>
- *
- * NOTES
- * JavaScript code.
- *****/
-
- if (!IS_isModuleInitialized("IS.NOF.UPDATE.HTML.UpdatesMainWindow"))
- {
- /****h* NOF_JavaScript_Library/NOF.UPDATE.HTML.UpdatesMainWindow
- *
- * NAME
- * NOF.UPDATE.HTML.UpdatesMainWindow
- *
- * DESCRIPTION
- *
- * The <code>UpdatesMainWindow</code> class, first tab panel editor.
- * External dependencies: NOF.App, NOF.HTML.EditorWindow, NOF.DIALOGS.ProgressDlg, NOF.DIALOGS.StatusDlg,
- * NOF.UI.TabbedMenu, NOF.UI.TabMenuItem
- ****/
-
- /** UpdatesMainWindow
- * @param _editedElem, the element being edited
- * @param _document, the browser document this editor will reside
- * @param _name
- */
- function NOF_UpdatesMainWindow( _editedElement, _document, _name ) {
-
- this.__proto__ = NOF_UpdatesMainWindow.prototype;
-
- if ( arguments.length == 0 )
- this.SUPER();
- else {
- this.SUPER( _editedElement, _document, _name );
- this.defaultName = "UPDATES_EDITOR";
-
- this.currentUpdateEditor = new NOF.UPDATE.HTML.CurrentUpdateEditor ( _editedElement, _document );
- this.previousUpdatesEditor = new NOF.UPDATE.HTML.PreviousUpdatesEditor ( _editedElement, _document );
-
- this.selectedDownloadLocation = null;
- }
-
- }
-
- NOF_UpdatesMainWindow.inherits( NOF.HTML.TabbedMenuEditorWindow )
- {
-
- var members = NOF_UpdatesMainWindow.prototype;
-
- members.defaultName = null;
-
- /**
- * onInit
- **/
- members.onInit = function () {
-
- this.addChild( this.currentUpdateEditor );
- this.addChild( this.previousUpdatesEditor );
-
- //initialize main tabbed menu
- var tabbedMenu = new NOF.UI.TabbedMenu( "updatesMainMenu", "NOF.UPDATES_MainMenu", this );
- tabbedMenu.setDocument ( this.getDoc() );
-
- tabbedMenu.addItem ( new NOF.UI.TabMenuItem ( this.currentUpdateEditor.getName(), this.getResourceProperty( "currentUpdateEditor.title" ), "content0" ) );
- tabbedMenu.addItem ( new NOF.UI.TabMenuItem ( this.previousUpdatesEditor.getName(), this.getResourceProperty( "previousUpdatesEditor.title" ), "content1" ) );
-
- tabbedMenu.addListener( this ); //adds it to all menu items
-
- this.setMenu ( tabbedMenu );
- NOF.addVariable ("UPDATES_MainMenu", tabbedMenu );
-
- this.super_onInit(); //this is implemented in base class and simply notifies the listners that this window has intitialised
- }
-
- /** method onLoad
- * @param
- * @return
- */
- members.onLoad = function () {
-
- //NOF.util_logging_ConsoleLogger_global.info("UpdatesMainWindow.onLoad begin");
-
- this.setTitle( this.getResourceProperty('UpdateAvailable.title') );
- this.setSize( this.getResourceProperty('UpdateAvailable.dlgWidth') - 0, this.getResourceProperty('UpdateAvailable.dlgHeight') - 0 );
-
- // select first tab
- var tabbedMenu = this.getMenu();
- tabbedMenu.selectItem( tabbedMenu.getItem( this.currentUpdateEditor.getName()) );
- this.currentUpdateEditor.show();
-
- // load editors
- this.currentUpdateEditor.onLoad();
- this.previousUpdatesEditor.onLoad();
-
- var ds = this.getDoc().getElementById("c.downloadFromSelect");
- this.selectedDownloadLocation = ds.options[ds.selectedIndex].text;
-
- //NOF.util_logging_ConsoleLogger_global.info("UpdatesMainWindow.onLoad this.selectedDownloadLocation = "+this.selectedDownloadLocation );
- //NOF.util_logging_ConsoleLogger_global.info("UpdatesMainWindow.onLoad end" );
- }
-
- /**
- * method onUpdateNow
- */
- members.onUpdateNow = function () {
- //NOF.util_logging_ConsoleLogger_global.info("UpdatesMainWindow.onUpdateNow selectedMenu - " + this.getMenu().getCurrentItem().getId() );
- dispatchEvent(this.getMenu().getCurrentItem().getId()+'.UpdateNow', null);
- }
-
- /**
- * method onDownload
- **/
- members.onDownload = function () {
- //NOF.util_logging_ConsoleLogger_global.info("UpdatesMainWindow.onDownload init " );
- var id = this.getMenu().getCurrentItem().getId();
- dispatchEvent(id+'.Download', null);
- }
-
- /** method onChangeDownloadLocation
- * @param source
- */
- members.onChangeDownloadLocation = function ( source ) {
-
- this.selectedDownloadLocation = source.options[source.selectedIndex].text;
- //NOF.util_logging_ConsoleLogger_global.info("UpdatesMainWindow.onChangeDownloadLocation selectedLocation - " + this.selectedDownloadLocation );
-
- var id = this.getMenu().getCurrentItem().getId();
- if ( this.currentUpdateEditor.getName() == id ) {
- this.previousUpdatesEditor.getDoc().getElementById("p.downloadFromSelect").selectedIndex = source.selectedIndex;
- } else { // must be previousUpdatesEditor
- this.currentUpdateEditor.getDoc().getElementById("c.downloadFromSelect").selectedIndex = source.selectedIndex;
- }
- }
-
- /**
- * method onUnload
- **/
- members.onUnload = function () {
- }
-
- }
-
- NOF.UPDATE.HTML.__proto__.UpdatesMainWindow = NOF_UpdatesMainWindow;
-
- }